/**
 * 路由表
 * @param resolve
 * @constructor
 */

const NotFoundComponent = resolve => require(['@/views/public/notFound.vue'], resolve);

/* layout */
import Layout from '@/views/index/layout/layout.vue';

/* login */
import Login from '@/views/index/login/login.vue'
// const authRedirect = ()=> import('@/views/index/login/auth-redirect.vue');

/* Error */
import Err404 from '@/views/index/error/404.vue'
import Err401 from '@/views/index/error/401.vue'


/* dashboard */
const Dashboard = ()=> import('@/views/index/dashboard/index.vue');

const StatLayout = ()=> import('@/views/index/layout/StatLayout.vue');
const StatComment = ()=> import('@/views/index/wx-stat/comment.vue');
const StatFans = ()=> import('@/views/index/wx-stat/fans.vue');
const StatFav = ()=> import('@/views/index/wx-stat/fav.vue');
const StatIndex = ()=> import('@/views/index/wx-stat/index.vue');
const StatPush = ()=> import('@/views/index/wx-stat/push.vue');
const StatRead = ()=> import('@/views/index/wx-stat/read.vue');
const StatShare = ()=> import('@/views/index/wx-stat/share.vue');



export const constantRouterMap = [
  { path: '/login', component: Login, hidden: true },
  // { path: '/authredirect', component: authRedirect, hidden: true },
  // { path: '/sendpwd', component: sendPWD, hidden: true },
  // { path: '/reset', component: reset, hidden: true },
  { path: '/404', component: Err404, hidden: true },
  { path: '/401', component: Err401, hidden: true },

  {
    path: '/dashboard',
    // component: Layout,
    redirect: '/wc-stat/index',
    icon: 'home',
    hidden: true,
    noDropdown: true,
    // children: [{ path: 'index', component: Dashboard, name: '控制台' }]
  },
  {
    path: '/wc-stat',
    component: StatLayout,
    redirect: '/wc-stat/index',
    icon: 'home',
    name: '数据分析',
    noDropdown: true,
    children: [
      { path: 'index', component: StatIndex, name: '数据概览', icon: 'stats' },
      { path: 'fans', component: StatFans, name: '粉丝数据', icon: 'fans' },
      { path: 'comment', component: StatComment, name: '粉丝互动', icon: 'comment' },
      { path: 'push', component: StatPush, name: '图文推送', icon: 'send' },
      { path: 'read', component: StatRead, name: '图文阅读', icon: 'read' },
      { path: 'share', component: StatShare, name: '图文分享', icon: 'share' },
      { path: 'fav', component: StatFav, name: '图文收藏', icon: 'fav' },
    ]
  },
  { path: '', redirect: '/dashboard', hidden: true },
]


export const asyncRouterMap = [
  // {
  //   path: '/error',
  //   component: Layout,
  //   redirect: 'noredirect',
  //   name: '错误页面',
  //   icon: '404',
  //   hidden: false,
  //   children: [
  //     { path: '401', component: Err401, name: '401' },
  //     { path: '404', component: Err404, name: '404' }
  //   ]
  // },
  { path: '*', redirect: '/404', hidden: true }
];
